#ifndef CHAINSAW_COMMON_READ_CONFIG_MESSAGE_H
#define CHAINSAW_COMMON_READ_CONFIG_MESSAGE_H

#include <vector>
#include <optional>
#include <string>

namespace chainsaw
{
    class ReadConfigMessage
    {
    public:
        ReadConfigMessage(std::string config_file);

        // key=xxx
        // we will find key=#[space]xxx in data.
        std::optional<std::vector<std::string>> get_value(std::string const &key) const;

        void print() const;
    private:
        struct kv
        {
            std::string key; // #[space]xxx
            std::vector<std::string> value;

            bool empty();

            void clear();
        };

        std::vector<kv> m_data;
    };
} // namespace chainsaw

#endif // !CHAINSAW_COMMON_READ_CONFIG_MESSAGE_H
